/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package magicthegathering;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import magicthegathering.MTG_Model;
/**
 *
 * @author Fluffy
 */
 public class MTG_Functions implements MTG_View{
   public MTG_Functions () {
        //I are constructor
    }
   public List<String> readfile(String filename) {
                String poop = "la";
        File dir1 = new File (".");

        try {
            poop = dir1.getCanonicalPath();
         }
        catch(Exception e) {
            e.printStackTrace();
        }

        poop = poop + File.separator + filename;

       File file = new File(poop);
       StringBuffer contents = new StringBuffer();
       BufferedReader reader = null;
       List<String> deck_list = new ArrayList();

       try
       {
           reader = new BufferedReader(new FileReader(file));
           String text = null;

           // repeat until all lines is read
            while ((text = reader.readLine()) != null)
            {
                 //  System.out.println(text);
                contents.append(text)
                    .append(System.getProperty(
                        "line.separator"));
              deck_list.add(text);

            }
        } catch (FileNotFoundException e)
       {
           e.printStackTrace();
        } catch (IOException e)
       {
            e.printStackTrace();
        } finally
       {
           try
            {
                if (reader != null)
               {
                    reader.close();
                }
           } catch (IOException e)
           {
               e.printStackTrace();
            }
        }
       return deck_list;
    }
   public void valueChanged(int oldValue){}
   public void Gameplay() {
     /*To create gameplay, must set a global variable into stages */
     int Turn = 1;
     /*Player 1's turn*/
     switch (Turn) {
         //Player 1 draw phase
         case 1:
         //Player 1 Place mana into play
         case 2:
         //Player 1 untap phase
         case 3:
         //player 1 spell use phase
         case 4:
         //player 1 attack phase
         case 5:
         //player 2 declare blockers
         case 6:
         //Combat and damage dealt
         case 7:
          //Player 2 draw phase
         case 8:
         //Player 2 Place mana into play
         case 9:
         //Player 2 untap phase
         case 10:
         //player 2 spell use phase
         case 11:
         //player 2 attack phase
         case 12:
         //player 1 declare blockers
         case 13:
         //Combat and damage dealt

     }

 }
}
